<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="../common.inc" %>    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link href="./css/style1.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="./js/form.js"></script>
<script type="text/javascript" language="javascript">
<!--
	function back(){
		var uri = "./saleCost.do?";
		var sign = "<c:out value='${sign}'/>";
		if(sign == "1"){//返回到通过待审的销售费用页面
			uri = "./saleCost.do";
		}else if(sign == "2"){//返回到待审的销售费用页面
			uri = "./saleCost.do?action=waitAuditSaleCost";
		}else if(sign == "3"){//返回到退回的销售费用页面
			uri = "./saleCost.do?action=returnSaleCost";
		}else if(sign == "4"){//返回到部门销售费用页面
			uri = "./saleCost.do?action=deptSaleCost";
		}else if(sign == "5"){//返回到审核管理－待审核的销售费用页面
			uri = "./auditManage.do?action=preAuditSaleCost";
		}
		window.location.href = uri;
		window.location.target = "main";
	}

-->
</script>
</head>
<body>
	<table class="table_frame" cellpadding="0" cellspacing="0">
		<tr>
			<td>
				<table class="table_title1">
					<tr>
						<td class="title_lab">查看费用</td>
					</tr>
					<tr>
						<td align="center" valign="bottom">
							<button class="btn_back" onclick="back()" hidefocus="true">返回</button>
						</td>
					</tr>
					<tr><td height="2"></td></tr>
				</table>
			</td>
		</tr>
		<tr>
			<td>
				<table class="table_title2">
					<tr>
						<td>
							<table class="table_add">
								<tr>
									<td class="title">单据编号：</td>
									<td>${saleCostCode}</td>
									<td class="title">当前累计费用：</td>
									<td><fmt:formatNumber value="${totalCost}" pattern="###,###,###,###.##"/>元</td>
								</tr>
								<c:forEach var="saleCost" items="${saleCosts}" begin="0" end="0">
								<tr>
									<td class="title">申请人：</td>
									<td>${saleCost.applyPerson}</td>
									<td class="title">申请日期：</td>
									<td><fmt:formatDate value="${saleCost.applyDate}" pattern="yyyy-MM-dd"/></td>
								</tr>
								<tr>
									<td class="title">审核人：</td>
									<td>${saleCost.auditPerson}</td>
									<td class="title">审核日期：</td>
									<td><fmt:formatDate value="${saleCost.auditDate}" pattern="yyyy-MM-dd HH:mm"/></td>
								</tr>
								</c:forEach>
							</table>
						</td>
					</tr>
					<tr>
						<td>
							<table class="table_style">
								<tr>
									<td class="title" width="8"></td>
									<td class="title" width="15%">费用类别</td>
									<td class="title" width="15%">费用金额(元)</td>
									<td class="title">客户名称</td>
									<td class="title" width="">用途描述</td>
								</tr>
								<c:forEach var="saleCost" items="${saleCosts}" varStatus="s">
								<tr onmouseover="onmousemoveChange(this,'img${saleCost.id}')" onmouseout="onmouseoutChange(this,'img${saleCost.id}')">
									<td height="16" width="8" align="right"><img id="img${saleCost.id}" src="./images/table_sign2.bmp"></td>
									<td>
									<c:forEach var="range" items="${costTypes}">
										<c:if test="${range.id == saleCost.costTypeId}">${range.rangeValue}</c:if>
									</c:forEach>
									</td>
									<td><fmt:formatNumber value="${saleCost.costValue}" pattern="###,###,###,###.##"/></td>
									<td align="left">${saleCost.customerName}</td>
									<td align="left">${saleCost.costDesc}</td>
								</tr>
								</c:forEach>
							</table>
						</td>
					</tr>
				</table>
			</td>
		</tr>
	</table>
</body>
</html>